﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Avatar.Model;
using AvatarHelper;

/// <summary>
///PositionManager 的摘要说明
/// </summary>
public class PositionManager
{
    /// <summary>
    /// 获取职位信息
    /// </summary>
    /// <param name="_id"></param>
    /// <returns></returns>
    public static Position GetPosition(int _id)
    {
        return DBHelper.Get<Position>(p => p.ID == _id, "获取职位信息出错：");
    }

    /// <summary>
    /// 获取职位信息分类列表
    /// </summary>
    /// <returns></returns>
    public static List<Position> GetPositionCategory()
    {
        return DBHelper.GetAll<Position>(p => p.FatherID == 0, "获取职位分类出错：");
    }

    /// <summary>
    /// 获取职位列表
    /// </summary>
    /// <param name="_fagtherID"></param>
    /// <returns></returns>
    public static List<Position> GetPositionList(int _fagtherID)
    {
        return DBHelper.GetAll<Position>(p=>p.FatherID==_fagtherID,"获取职位列表出错：");
    }
}
